var TaskWatchInfo = function(){
	var taskTitle = new Ext.form.TextField({
		fieldLabel : '任务名称',
		width : 420
	});
	
	var taskContent = new Ext.form.HtmlEditor({
		fieldLabel: '任务内容',
		width:420,
		height:200,
		enableSourceEdit: false,
		autoScroll:true,
		designMode:'off'//Modified by wilson
	});
	
	var taskDate = new Ext.form.TextField({
		fieldLabel : '派发时间',
		width : 125
	});
	
	var taskComplateDate = new Ext.form.TextField({
		fieldLabel : '完结时间',
		width : 125
	});
	
	var taskSource = new Ext.form.TextField({
		fieldLabel : '任务来源',
		width : 120
	});
	
	var taskDis = new Ext.form.TextField({
		fieldLabel : '派发人',
		width : 120
	});
	
	var taskFinStatus = new Ext.form.TextField({
		fieldLabel : '任务状态',
		width : 120
	});
	
	var taskForm = new Ext.form.FormPanel({
		frame : true,
		labelWidth : 65,
		labelAlign : 'right',
		items : [taskTitle,taskContent,
		         {layout:'column',defaults:{columnWidth:.5,layout:'form'},
		          items:[{items:[taskDate,taskSource,taskDis]},
		                 {items:[taskComplateDate,taskFinStatus]}]}]
	});
	
	var taskItemStore = new Ext.data.JsonStore({
		url : '../task/watchTaskItemByTask.form?timesnap=' + Date.parse(new Date()),
		method : 'POST',
		root : 'result',
		fields : ['TASK_EXE_ID','TASK_EXE_UPDATE_DATE','TASK_ID','USER_NAME','DIS_NAME',
		          'TASK_EXE_PERFORM_TYPE','TASK_EXE_PERCENT','TASK_EXE_STATUS']
	});
	
	var taskItemGrid = new Ext.grid.GridPanel({
		height : 300,
		store : taskItemStore,
		scope : this,
		columns : [{header:'任务派发人',dataIndex:'DIS_NAME'},
		           {header:'任务执行人',dataIndex:'USER_NAME'},
		           {header:'任务更新时间',dataIndex:'TASK_EXE_UPDATE_DATE'},
		           {header:'任务?',dataIndex:'TASK_EXE_PERFORM_TYPE'},
		           {header:'任务完成百分比',hiddden:true,dataIndex:'TASK_EXE_PERCENT'},
		           {header:'任务状态',dataIndex:'TASK_EXE_STATUS',
		        	   renderer:function(value){return OMS.TASKSEXESTATUS[value]}}]
	});
	
	var taskPanel = new Ext.TabPanel( {
		activeTab : 0,
		width : 550,
		border : false,
		items : [ {
			title : '任务信息',
			autoHeight : true,
			items : [ taskForm ]
		}/*,{
			title : '任务子项信息',
			autoHeight : true,
			items : [ taskItemGrid ]
		}*/]
	});
	
	var taskWin = new Ext.Window({
		title : '任务详细信息',
		resizable : false,
		closeAction : 'hide',
		width : 550,
		items : [taskPanel]
	});
	
	this.initTaskWatchInfo = function(task){
		taskTitle.setValue(task.TASK_TITLE);
		taskContent.setValue(task.TASK_CONTENT);
		taskDate.setValue(task.TASK_DATE);
		taskComplateDate.setValue(task.TASK_COMPLETE_DATE);
		taskSource.setValue(OMS.TASKORIGIN[task.TASK_ORIGIN]);
		taskFinStatus.setValue(OMS.TASKSTATUS[task.TASK_STATUS]);
		taskDis.setValue(task.DIS_NAME);
		taskItemStore.load({params:{taskId:task.TASK_ID}});
		taskWin.show();
	};
};